package com.feducation.json;

import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;

/**
 * 返回json封装
 */
public class ResponseJson {

    public static <T> ResponseEntity<T> requestEntity(T body){
        HttpHeaders httpHeaders = new HttpHeaders();
        String contentType = "text/html; charset=utf-8";
        httpHeaders.add("contentType", contentType);
        return new ResponseEntity<T>(body, httpHeaders, HttpStatus.OK);
    }
}
